{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ $page := .Page }}
{{ $last := false }}
{{ $done := false }}
{{ range $index := split $url "/" }}
    {{ if $page }}
        {{ if not $done }}
            {{ $.Scratch.Add "urls" (slice $page.Permalink) }}
            {{ $.Scratch.Add "titles" (slice $page.LinkTitle) }}
            {{ $.Scratch.Add "descriptions" (slice $page.Description) }}

            {{ if $last }}
                {{ $done = true }}
            {{ end }}

            {{ $parent := path.Dir (path.Dir $page.File.Path) }}
            {{ if eq $parent "." }}
                {{ $last = true }}
                {{ $page = $page.Site.GetPage "home" }}
            {{ else }}
                {{ $page = $page.GetPage $parent }}
            {{ end }}
        {{ end }}
    {{ end }}
{{ end }}

<ol>
    {{ $len := len ($.Scratch.Get "titles") }}
    {{ range $index, $element := $.Scratch.Get "titles" }}
        {{ $i := sub (sub $len $index) 1 }}
        {{ $title := index ($.Scratch.Get "titles") $i }}
        {{ $description := index ($.Scratch.Get "descriptions") $i }}
        {{ $url := index ($.Scratch.Get "urls") $i }}

        {{ if ne $i 0 }}
            <li><a href="{{- $url -}}" title="{{- $description -}}">{{- $title -}}</a></li>
        {{ else }}
            <li>{{- $title -}}</li>
        {{ end }}
    {{ end }}
</ol>
